from subway_qa.adapters import messages_to_text

PROMPT = """请你将用户说的话转换为文字，只输出转换后的结果，不要输入其他内容"""


def run(audio_path: str) -> str:
    messages = [
        {
            "role": "user",
            "content": [
                {"type": "text", "text": PROMPT},
                {
                    "type": "audio",
                    "audio": audio_path,
                },
            ],
        },
    ]
    return messages_to_text(messages)


if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument("--audio_path", type=str, required=True)
    args = parser.parse_args()
    print(run(args.audio_path))